package summer_vacation.zengguangchuan;

import java.util.Scanner;

/**  作业12
 * Created by lenovo0 on 2015/8/24.
 */
public class Assignment_2 {
    public static void main(String[] args) {
        int a, b, i;
        System.out.print("请输入一个整数：");
        Scanner input = new Scanner(System.in);
        b = input.nextInt();
        i =(int) b / 2;
        for (a = 2; a <= i; a++) {
            if (b % a == 0) {
                System.out.println("此数不是素数");
                break;
            }
        } if (a > i) {
            System.out.println("此数是素数");
        }

    }
}
